<template>
  <a-config-provider :locale="locale">
    <router-view></router-view>
  </a-config-provider>
</template>

<script lang="ts" setup>
import { useRouter } from 'vue-router'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import { useStore } from 'vuex'
const locale = zhCN
const router = useRouter()
  

const toRouter = (path: string) => {
  router.push(microApp.help.getPath(path))
}
const microApp = window.__MicroAPP__

if (microApp) {
  const props = microApp.basic.getCurrentAppProps(window)
  if (props) {
    if (props.path) {
      toRouter(props.path)
    }
    microApp.bus.onRouterChanged({
      appName: props.name,
      callback: ({ path }: any) => {
        toRouter(path)
      }
    })
  }
}
</script>

<style>
#vite-ai-app-demo {
  height: 100%;
}
</style>
